package cn.tedu;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

public class Demo05 {
    public static void main(String[] args) {

        try (Connection coon=DBUtils.getCoon();){
            Statement s =coon.createStatement();
            ResultSet rs= s.executeQuery("select name,sal,job from emp");
            while (rs.next()){
//                String name=rs.getString("name");
//                double sal=rs.getDouble("sal");
//                String job=rs.getString("job");
                String name=rs.getString(1);
                double sal=rs.getDouble(2);
                String job=rs.getString(3);
                System.out.println(name+":"+sal+":"+job);
            }
        } catch (SQLException throwables) {
            throwables.printStackTrace();
        }
    }
}
